# Define source file folder to SRC_LIST
ifeq ($(strip $(DSP_SOLUTION)),DUALMACDSP)
   AUDFOLDER         =  hal\audio\src\v2
   AUD_SOLUTION      =  V2
else   
   ifneq ($(strip $(SMART_PHONE_CORE)),NONE)
      AUDFOLDER         =  hal\audio\src\v1\sp
      AUD_SOLUTION      =  V1_SP
   else 
      AUDFOLDER         =  hal\audio\src\v1
      AUD_SOLUTION      =  V1
   endif
endif


# Start Define source file lists to SRC_LIST
# Common part in v1, v2 and v1SP
SRC_LIST = $(strip $(AUDFOLDER))\afe2.c \
           $(strip $(AUDFOLDER))\am.c \
           $(strip $(AUDFOLDER))\sp_drv.c \
           $(strip $(AUDFOLDER))\tone2.c \
           $(strip $(AUDFOLDER))\vm.c \
           $(strip $(AUDFOLDER))\media.c \
           $(strip $(AUDFOLDER))\l1audio_trace.c \
           $(strip $(AUDFOLDER))\pcm4way.c \
           $(strip $(AUDFOLDER))\audio_service.c \
           interface\audio\audio_create.c
           
# Common part in V1_SP
ifeq ($(strip $(AUD_SOLUTION)),V1_SP)
   SRC_LIST += $(strip $(AUDFOLDER))\vm_strm_drv.c \
               $(strip $(AUDFOLDER))\bgsnd_drv.c \
               $(strip $(AUDFOLDER))\sp_enhance.c \
               $(strip $(AUDFOLDER))\wav_thumb.c
else
# Common part in V1 and V2
   SRC_LIST += $(strip $(AUDFOLDER))\vm_drv.c \
               $(strip $(AUDFOLDER))\spt_analyzer.c \
               $(strip $(AUDFOLDER))\audioPP.c \
               $(strip $(AUDFOLDER))\PCMRB.c \
               $(strip $(AUDFOLDER))\audioCF.c \
               $(strip $(AUDFOLDER))\tone_loopback_rec.c \
               
   ifeq ($(strip $(AUD_SOLUTION)),V1)
      SRC_LIST += $(strip $(AUDFOLDER))\audio_idma.c \
                  $(strip $(AUDFOLDER))\sp_enhance.c \
                  $(strip $(AUDFOLDER))\ut_hqa_test.c
      ifneq ($(filter __DRA_DECODE_SUPPORT__, $(strip $(MODULE_DEFS))),)
        SRC_LIST += $(strip $(AUDFOLDER))\dra_drv.c
      endif
      ifneq ($(filter STREAM_SUPPORT, $(strip $(MODULE_DEFS))),)
        SRC_LIST += $(strip $(AUDFOLDER))\audio_rtp.c \
                    $(strip $(AUDFOLDER))\rtp_amr_drv.c \
                    $(strip $(AUDFOLDER))\rtp_aac_drv.c \
                    $(strip $(AUDFOLDER))\rtp_daf_drv.c \
                    $(strip $(AUDFOLDER))\rtp_dra_drv.c \
                    $(strip $(AUDFOLDER))\rtp_cook_drv.c
      else
        ifneq ($(filter __MTV_SUPPORT__, $(strip $(MODULE_DEFS))),)
          SRC_LIST += $(strip $(AUDFOLDER))\audio_rtp.c \
                      $(strip $(AUDFOLDER))\rtp_amr_drv.c \
                      $(strip $(AUDFOLDER))\rtp_aac_drv.c \
                      $(strip $(AUDFOLDER))\rtp_daf_drv.c \
                      $(strip $(AUDFOLDER))\rtp_dra_drv.c \
                      $(strip $(AUDFOLDER))\rtp_cook_drv.c
        endif
     endif
     ifneq ($(filter AWB_PLUS_DECODE, $(strip $(MODULE_DEFS))),)
        ifneq ($(filter STREAM_SUPPORT, $(strip $(MODULE_DEFS))),)
          SRC_LIST += $(strip $(AUDFOLDER))\rtp_awp_drv.c
        else
          ifneq ($(filter __MTV_SUPPORT__, $(strip $(MODULE_DEFS))),)
            SRC_LIST += $(strip $(AUDFOLDER))\rtp_awp_drv.c
          endif
        endif
     endif
   endif
   
   ifeq ($(strip $(AUD_SOLUTION)),V2)
      SRC_LIST += $(strip $(AUDFOLDER))\spc_drv.c \
                  $(strip $(AUDFOLDER))\ut_acoustic_loopback.c \
                  $(strip $(AUDFOLDER))\dpmgr.c
      ifneq ($(filter DSP_WT_SYN, $(strip $(MODULE_DEFS))),)
         SRC_LIST += $(strip $(AUDFOLDER))\Wavetable_SW.c
      endif
   endif
endif
ifneq ($(filter WAV_CODEC, $(strip $(MODULE_DEFS))),)
   SRC_LIST += $(strip $(AUDFOLDER))\pcm.c \
       $(strip $(AUDFOLDER))\pcm_strm_drv.c
endif
ifneq ($(filter __UMTS_RAT__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\amr_table.c \
                 $(strip $(AUDFOLDER))\sp_3g.c
else
  ifneq ($(filter __UMTS_TDD128_MODE__, $(strip $(MODULE_DEFS))),)
    SRC_LIST += $(strip $(AUDFOLDER))\amr_table.c \
                $(strip $(AUDFOLDER))\sp_3g.c
  endif
endif
ifneq ($(filter BGSND_ENABLE, $(strip $(MODULE_DEFS))),)
  SRC_LIST += $(strip $(AUDFOLDER))\snd_effect.c
endif
ifneq ($(filter WAV_CODEC, $(strip $(MODULE_DEFS))),)
  SRC_LIST += $(strip $(AUDFOLDER))\wav_thumb.c
  WAV_DRIVER_NOT_SUPPORT_PLATFORM = MT6516 MT6573
  ifeq ($(filter $(strip $(PLATFORM)) ,$(WAV_DRIVER_NOT_SUPPORT_PLATFORM)),)
    SRC_LIST += $(strip $(AUDFOLDER))\wav_drv_thumb.c
    ifeq ($(strip $(AUD_SOLUTION)),V2)
       SRC_LIST += $(strip $(AUDFOLDER))\wav_drv.c
    endif
  endif
endif
ifeq ($(strip $(SMART_PHONE_CORE)),NONE)
   ifneq ($(filter AAC_DECODE, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\aac_drv.c
   endif
   ifneq ($(filter AAC_PLUS_DECODE, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\aac_huffman_table.c
   endif
   ifneq ($(filter AMR_CODEC, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\amr.c \
                 $(strip $(AUDFOLDER))\amr_table.c \
                 $(strip $(AUDFOLDER))\amr_drv.c
     ifneq ($(filter DEDI_AMR_REC, $(strip $(MODULE_DEFS))),)
       SRC_LIST += $(strip $(AUDFOLDER))\amr_dedi.c
     endif
   endif
   ifneq ($(filter __APE_DECODE__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\ape_drv.c
   endif
   ifneq ($(filter __ENABLE_AUDIO_DVT__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\audio_DVT.c
   endif
   ifneq ($(filter __AUDIO_DSP_LOWPOWER__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\audlp_drv.c \
                 $(strip $(AUDFOLDER))\audlp_nfi_dsp_drv.c
   endif
   ifneq ($(filter __BT_AUDIO_VIA_SCO__, $(strip $(MODULE_DEFS))),)
     ifeq ($(strip $(AUD_SOLUTION)),V1)
       SRC_LIST += $(strip $(AUDFOLDER))\AVB.c
     endif
   endif
   ifneq ($(filter AWB_PLUS_DECODE, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\awb_plus_drv.c
   endif
   ifneq ($(filter __COOK_DECODE__, $(strip $(MODULE_DEFS))),)
     ifeq ($(filter __COOK_DECODE_DSP__, $(strip $(MODULE_DEFS))),)
       SRC_LIST += $(strip $(AUDFOLDER))\cook_drv.c
     endif
   endif
   ifneq ($(filter __COOK_DECODE__, $(strip $(MODULE_DEFS))),)
     ifneq ($(filter __COOK_DECODE_DSP__, $(strip $(MODULE_DEFS))),)
       SRC_LIST += $(strip $(AUDFOLDER))\ra_drv.c
     endif
   endif
   ifneq ($(filter DAF_DECODE, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\daf_drv.c
   endif
   ifneq ($(filter __BES_EQ_SUPPORT__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\eq_table.c
   endif
   ifneq ($(filter __I2S_INPUT_MODE_SUPPORT__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\i2s_drv.c
   endif
   ifneq ($(filter __CTM_SUPPORT__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\ctm_drv.c
   endif
   ifneq ($(filter CYBERON_DIC_TTS, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\tts_drv.c
   else
     ifneq ($(filter IFLY_TTS, $(strip $(MODULE_DEFS))),)
       SRC_LIST += $(strip $(AUDFOLDER))\tts_drv.c
       endif
   endif
   ifneq ($(filter SINOVOICE_TTS, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\tts_drv.c
   endif   
   ifneq ($(filter __BT_A2DP_PROFILE__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\sbc_drv.c \
                 $(strip $(AUDFOLDER))\daf_rtpss.c
   endif
   ifneq ($(filter UT_2WAYWB_RECORD_SUPPORT, $(strip $(MODULE_DEFS))),)
     ifneq ($(filter __UTIL_CLI_SUPPORT__, $(strip $(MODULE_DEFS))),)
       SRC_LIST += $(strip $(AUDFOLDER))\ut_2waywb_record.c
     endif
   endif
   ifneq ($(filter __ACOUSTIC_LOOPBACK_SUPPORT__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\ut_acoustic_loopback.c
   endif
   ifneq ($(filter __UTIL_CLI_SUPPORT__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\util_cli_input.c \
                 $(strip $(AUDFOLDER))\util_cli_parser.c \
                 $(strip $(AUDFOLDER))\util_cli_task.c \
                 $(strip $(AUDFOLDER))\util_aud_cmd.c
   endif
   ifneq ($(filter __LG_VOICE_ENGINE__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\voice_clarity.c
   endif
   ifneq ($(filter VRSI_CYBERON, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\vr_si.c
   endif
   #ifneq ($(filter DSP_WT_SYN, $(strip $(MODULE_DEFS))),)
   #  SRC_LIST += $(strip $(AUDFOLDER))\Wavetable_DSPv1.c \
   #              $(strip $(AUDFOLDER))\Wavetable_DSPv2.c
   #endif
   ifneq ($(filter WMA_DECODE, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\wma_drv.c
   endif
   ifneq ($(filter __DAF_ENCODE__, $(strip $(MODULE_DEFS))),)
     SRC_LIST +=  $(strip $(AUDFOLDER))\mp3enc\mp3_enc_drv.c
   endif
   #ifneq ($(filter AAC_DECODE, $(strip $(MODULE_DEFS))),)
   #  SRC_LIST += $(strip $(AUDFOLDER))\cpr_protection.c
   #else
   #  ifneq ($(filter DAF_DECODE, $(strip $(MODULE_DEFS))),)
   #    SRC_LIST += $(strip $(AUDFOLDER))\cpr_protection.c
   #    endif
   #endif
   ifneq ($(filter __BT_SUPPORT__, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\BT_PcmLoopback.c
     ifneq ($(filter BT_Loopback_Test, $(strip $(COMP_DEFS))),)
       SRC_LIST += $(strip $(AUDFOLDER))\BT_loopback.c
     endif   
   endif
   ifneq ($(filter DSP_WT_SYN, $(strip $(MODULE_DEFS))),)
     ifeq ($(strip $(AUD_SOLUTION)),V1)
        DSP_WT_SYN_V1_SUPPORT_PLATFORM = MT6219 MT6223 MT6225 MT6229 MT6253T MT6253 MT6268A MT6268T MT6268H MT6223P
        ifneq ($(filter $(strip $(PLATFORM)) ,$(DSP_WT_SYN_V1_SUPPORT_PLATFORM)),)
           SRC_LIST += $(strip $(AUDFOLDER))\Wavetable_DSPv1.c
        else
           SRC_LIST += $(strip $(AUDFOLDER))\Wavetable_DSPv2.c
        endif
     endif
   endif
   ifneq ($(filter STREAM_SUPPORT, $(strip $(MODULE_DEFS))),)
     SRC_LIST += $(strip $(AUDFOLDER))\poc_amr.c
   else
     ifneq ($(filter __VOIP__, $(strip $(MODULE_DEFS))),)
       SRC_LIST += $(strip $(AUDFOLDER))\poc_amr.c
       endif
   endif
endif           
#  Define include path lists to INC_DIR
INC_DIR = $(strip $(AUDFOLDER))  \
          l1\l1d \
          $(strip $(AUDFOLDER))\inc \
          $(strip $(AUDFOLDER))\comp \
          $(strip $(AUDFOLDER))\comp\VoRTP \
          $(strip $(AUDFOLDER))\TC01 \
          interface\hal\audio \
          hal\audio\lib\daf\mp3frmlen \
          media\common\include \
          hal\dsp_ram \
          dp_engine\amr515 \
          dp_engine\amr \
          dp_engine\aac_ARM_decode_SWIP \
          dp_engine\wav_ARM_codec \
          dp_engine\cook_ARM_decode \
          hal\dp_engine\ctm \
          dp_engine\g729 \
          dp_engine\opengl \
          dp_engine\sbc \
          dp_engine\apm \
          dp_engine\aac_ARM_decode \
          dp_engine\ape_ARM_decode \
          $(strip $(PS_FOLDER))\l4\include \
          dp_engine\g726 \
          dp_engine\G711_CNG \
          dp_engine\LowcFE \
          dp_engine\resample \
          dp_engine\TimeScaling \
          dp_engine\BesSound\inc \
          dp_engine\amrwb \
          dp_engine\ipcommon \
          init\FTL \
          $(strip $(AUDFOLDER))\mp3enc \
          drv\include \
          interface\hwdrv \
          hal\video\demuxer\mp4_parser\inc

ifneq ($(filter __MMI_DSM_NEW__ , $(strip $(MODULE_DEFS))),)                  
	INC_DIR += plutommi\mmi\mythroad\mythroadinc
endif 
 
# Define the specified compile options to COMP_DEFS
COMP_DEFS = APCS_INTWORK
 
# Define the source file search paths to SRC_PATH
SRC_PATH = $(strip $(AUDFOLDER)) \
          interface\hal\audio \
          $(strip $(AUDFOLDER))\inc \
          $(strip $(AUDFOLDER))\comp \
          $(strip $(AUDFOLDER))\comp\VoRTP \
          $(strip $(AUDFOLDER))\tts \
          interface\bt \
          $(strip $(AUDFOLDER))\mp3enc
 
